'use strict';

module.exports = (app) => {
    const {DataTypes} = app.Sequelize;
    const Image = app.model.define('image', {
        id: { 
            type: DataTypes.UUID,
            defaultValue: app.Sequelize.UUIDV4, 
            primaryKey: true,
            notNull: true,
            comment: 'ID'
        },
        belongID: { 
          type: DataTypes.UUID,
          notNull: true,
          comment: 'ID'
      },
      h:{type:DataTypes.INTEGER},
      w:{type:DataTypes.INTEGER},
      fileName:{type: DataTypes.STRING(100),comment: '图片的标题'},
      url:{type: DataTypes.STRING(500),comment: '图片的url'},
      orderBy:{type:DataTypes.INTEGER,primaryKey: true,},
      extID:{ 
          type: DataTypes.UUID,
          comment: 'ID',
          defaultValue: app.Sequelize.UUIDV4, 
      },
    },
  );
  Image.sync()
  return Image;
};